using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for QT_PROMOTION.
    /// </summary>
    public class QT_PROMOTION
    {
              private string _ID;
      private string _Name;
      private decimal _DiscountMoney;
      private double _DiscountPercent;
      private DateTime _DateBegin;
      private DateTime _DateEnd;
      private string _TypeDiscount;
      private DateTime _DateCreate;
      private string _UserName;
      private bool _IsUse;
      private bool _IsEnd;
      private string _Note;
      private string _IDPOS;
      private QT_EXPORTBILLList _listQT_EXPORTBILL;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetID; 
      public bool IsIDNullable   
      { 
	 get { return false;  } 
      }
      public string ID
      {
         get { return _ID; }
         set 
	    { 
 		 _ID = value;
		IsSetID = true;
 	    }
      }
    public bool IsSetName; 
    public bool IsNameNullable   
    { 
		get { return false;  } 
    }
    public string Name
    {
        get{ return _Name;  }
        set
		{
			_Name = value;
			IsSetName = true;
		}
    }
    public bool IsSetDiscountMoney; 
    public bool IsDiscountMoneyNullable   
    { 
		get { return false;  } 
    }
    public decimal DiscountMoney
    {
        get{ return _DiscountMoney;  }
        set
		{
			_DiscountMoney = value;
			IsSetDiscountMoney = true;
		}
    }
    public bool IsSetDiscountPercent; 
    public bool IsDiscountPercentNullable   
    { 
		get { return false;  } 
    }
    public double DiscountPercent
    {
        get{ return _DiscountPercent;  }
        set
		{
			_DiscountPercent = value;
			IsSetDiscountPercent = true;
		}
    }
    public bool IsSetDateBegin; 
    public bool IsDateBeginNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateBegin
    {
        get{ return _DateBegin;  }
        set
		{
			_DateBegin = value;
			IsSetDateBegin = true;
		}
    }
    public bool IsSetDateEnd; 
    public bool IsDateEndNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateEnd
    {
        get{ return _DateEnd;  }
        set
		{
			_DateEnd = value;
			IsSetDateEnd = true;
		}
    }
    public bool IsSetTypeDiscount; 
    public bool IsTypeDiscountNullable   
    { 
		get { return false;  } 
    }
    public string TypeDiscount
    {
        get{ return _TypeDiscount;  }
        set
		{
			_TypeDiscount = value;
			IsSetTypeDiscount = true;
		}
    }
    public bool IsSetDateCreate; 
    public bool IsDateCreateNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateCreate
    {
        get{ return _DateCreate;  }
        set
		{
			_DateCreate = value;
			IsSetDateCreate = true;
		}
    }
    public bool IsSetUserName; 
    public bool IsUserNameNullable   
    { 
		get { return false;  } 
    }
    public string UserName
    {
        get{ return _UserName;  }
        set
		{
			_UserName = value;
			IsSetUserName = true;
		}
    }
    public bool IsSetIsUse; 
    public bool IsIsUseNullable   
    { 
		get { return false;  } 
    }
    public bool IsUse
    {
        get{ return _IsUse;  }
        set
		{
			_IsUse = value;
			IsSetIsUse = true;
		}
    }
    public bool IsSetIsEnd; 
    public bool IsIsEndNullable   
    { 
		get { return false;  } 
    }
    public bool IsEnd
    {
        get{ return _IsEnd;  }
        set
		{
			_IsEnd = value;
			IsSetIsEnd = true;
		}
    }
    public bool IsSetNote; 
    public bool IsNoteNullable   
    { 
		get { return false;  } 
    }
    public string Note
    {
        get{ return _Note;  }
        set
		{
			_Note = value;
			IsSetNote = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }
public QT_EXPORTBILLList QT_EXPORTBILLList 
{ 
	get { return _listQT_EXPORTBILL; }
	set { _listQT_EXPORTBILL = value;}
}

        #endregion

        #region Constructors
        public QT_PROMOTION()
        {
            Reset();
        }
        public QT_PROMOTION(QT_PROMOTION obj)
        {
            	this._ID = obj.ID;
	this._Name = obj.Name;
	this._DiscountMoney = obj.DiscountMoney;
	this._DiscountPercent = obj.DiscountPercent;
	this._DateBegin = obj.DateBegin;
	this._DateEnd = obj.DateEnd;
	this._TypeDiscount = obj.TypeDiscount;
	this._DateCreate = obj.DateCreate;
	this._UserName = obj.UserName;
	this._IsUse = obj.IsUse;
	this._IsEnd = obj.IsEnd;
	this._Note = obj.Note;
	this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
                     _ID = EmptyValues.v_string;
         _Name = EmptyValues.v_string;
         _DiscountMoney = EmptyValues.v_decimal;
         _DiscountPercent = EmptyValues.v_double;
         _DateBegin = EmptyValues.v_DateTime;
         _DateEnd = EmptyValues.v_DateTime;
         _TypeDiscount = EmptyValues.v_string;
         _DateCreate = EmptyValues.v_DateTime;
         _UserName = EmptyValues.v_string;
         _IsUse = EmptyValues.v_bool;
         _IsEnd = EmptyValues.v_bool;
         _Note = EmptyValues.v_string;
         _IDPOS = EmptyValues.v_string;
	_listQT_EXPORTBILL = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (string)reader["ID"];
		}
                if(!(reader["Name"] is DBNull))
		{
			obj.Name = (string)reader["Name"];
		}
                if(!(reader["DiscountMoney"] is DBNull))
		{
			obj.DiscountMoney = (decimal)reader["DiscountMoney"];
		}
                if(!(reader["DiscountPercent"] is DBNull))
		{
			obj.DiscountPercent = (double)reader["DiscountPercent"];
		}
                if(!(reader["DateBegin"] is DBNull))
		{
			obj.DateBegin = (DateTime)reader["DateBegin"];
		}
                if(!(reader["DateEnd"] is DBNull))
		{
			obj.DateEnd = (DateTime)reader["DateEnd"];
		}
                if(!(reader["TypeDiscount"] is DBNull))
		{
			obj.TypeDiscount = (string)reader["TypeDiscount"];
		}
                if(!(reader["DateCreate"] is DBNull))
		{
			obj.DateCreate = (DateTime)reader["DateCreate"];
		}
                if(!(reader["UserName"] is DBNull))
		{
			obj.UserName = (string)reader["UserName"];
		}
                if(!(reader["IsUse"] is DBNull))
		{
			obj.IsUse = (bool)reader["IsUse"];
		}
                if(!(reader["IsEnd"] is DBNull))
		{
			obj.IsEnd = (bool)reader["IsEnd"];
		}
                if(!(reader["Note"] is DBNull))
		{
			obj.Note = (string)reader["Note"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["ID"];
//            _Name = (reader["Name"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Name"];
//            _DiscountMoney = (reader["DiscountMoney"] is DBNull)?DalTools.EmptyValues.v_decimal:(decimal)reader["DiscountMoney"];
//            _DiscountPercent = (reader["DiscountPercent"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["DiscountPercent"];
//            _DateBegin = (reader["DateBegin"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateBegin"];
//            _DateEnd = (reader["DateEnd"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateEnd"];
//            _TypeDiscount = (reader["TypeDiscount"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["TypeDiscount"];
//            _DateCreate = (reader["DateCreate"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateCreate"];
//            _UserName = (reader["UserName"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["UserName"];
//            _IsUse = (reader["IsUse"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["IsUse"];
//            _IsEnd = (reader["IsEnd"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["IsEnd"];
//            _Note = (reader["Note"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Note"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string ID, string Name, decimal DiscountMoney, double DiscountPercent, DateTime DateBegin, DateTime DateEnd, string TypeDiscount, DateTime DateCreate, string UserName, bool IsUse, bool IsEnd, string Note, string IDPOS)
        {
                     this._ID = ID;
         this._Name = Name;
         this._DiscountMoney = DiscountMoney;
         this._DiscountPercent = DiscountPercent;
         this._DateBegin = DateBegin;
         this._DateEnd = DateEnd;
         this._TypeDiscount = TypeDiscount;
         this._DateCreate = DateCreate;
         this._UserName = UserName;
         this._IsUse = IsUse;
         this._IsEnd = IsEnd;
         this._Note = Note;
         this._IDPOS = IDPOS;
        }
    }
}